{extend name="sitehome@style/base"/}
{block name="resources"}
{/block}
{block name="main"}
<div class="layui-form">
    <div class="nc-quote-box">
        <blockquote class="layui-elem-quote layui-quote-nm">属性添加</blockquote>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="required">*</span>属性名称</label>
            <div class="layui-input-inline">
                <input type="text" name="attribute_name" lay-verify="attribute_name" autocomplete="off" placeholder="" class="layui-input nc-len-long">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">类型</label>
            <div class="layui-input-inline">
                <select name="input_type"  class="nc-len-long" lay-filter="input_type" >
                    <option value="0">请选择</option>
                    {volist name="input_type_arr" id="vo"}
                    <option value="{$vo.type}">{$vo.name}</option>
                    {/volist}
                </select>
            </div>
        </div>

        <!--单行文本-->
        <div class="layui-form-item nc_hide" data-name="args_text">
            <label class="layui-form-label">最大长度</label>
            <div class="layui-input-inline">
                <input type="text" name="text_length" autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_text">
            <label class="layui-form-label">默认值</label>
            <div class="layui-input-inline">
                <input type="text" name="text_default_value" autocomplete="off" placeholder="" class="layui-input nc-len-mid">
            </div>
        </div>

        <!--多行文本框-->
        <div class="layui-form-item nc_hide" data-name="args_textarea">
            <label class="layui-form-label">宽</label>
            <div class="layui-input-inline">
                <input type="text" name="textarea_width" autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_textarea">
            <label class="layui-form-label">高</label>
            <div class="layui-input-inline">
                <input type="text" name="textarea_height" autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_textarea">
            <label class="layui-form-label">默认值</label>
            <div class="layui-input-inline">
                <input type="text" name="textarea_default_value" autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>

        <!--编辑器-->
        <div class="layui-form-item nc_hide" data-name="args_editor">
            <label class="layui-form-label">高</label>
            <div class="layui-input-inline">
                <input type="text" name="editor_height" autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_editor">
            <label class="layui-form-label">默认值</label>
            <div class="layui-input-inline">
                <input type="text" name="editor_default_value" autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>

        <!--下拉框-->
        <div class="layui-form-item nc_hide" data-name="args_select">
            <label class="layui-form-label">选项列表</label>
            <div class="layui-input-inline">
                <input type="text" name="select_option" autocomplete="off" placeholder="例：男/女" class="layui-input nc-len-short">
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_select">
            <label class="layui-form-label">默认值</label>
            <div class="layui-input-inline">
                <input type="text" name="select_default_value" autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>

        <!--单选按钮-->
        <div class="layui-form-item nc_hide" data-name="args_radio">
            <label class="layui-form-label">选项列表</label>
            <div class="layui-input-inline">
                <input type="text" name="radio_option" autocomplete="off" placeholder="例：男/女" class="layui-input nc-len-short">
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_radio">
            <label class="layui-form-label">默认值</label>
            <div class="layui-input-inline">
                <input type="text" name="radio_default_value" autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>

        <!--复选框-->
        <div class="layui-form-item nc_hide" data-name="args_checkbox">
            <label class="layui-form-label">选项列表</label>
            <div class="layui-input-inline">
                <input type="text" name="checkbox_option" autocomplete="off" placeholder="例：男/女" class="layui-input nc-len-short">
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_checkbox">
            <label class="layui-form-label">默认值</label>
            <div class="layui-input-inline">
                <input type="text" name="checkbox_default_value" autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>

        <!--图片-->
        <div class="layui-form-item nc_hide" data-name="args_img">
            <label class="layui-form-label">允许图片类型</label>
            <div class="layui-input-inline">
                <input type="text" name="img_allow_image_type" autocomplete="off" value="jpg,png,gif" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_img">
            <label class="layui-form-label">开启图片水印</label>
            <div class="layui-input-inline">
                <select name="img_open_image_mark"  class="nc-len-long">
                    <option value="0">否</option>
                    <option value="1">是</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_img">
            <label class="layui-form-label">缩略图宽</label>
            <div class="layui-input-inline">
                <input type="text" name="img_width" autocomplete="off" value="" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_img">
            <label class="layui-form-label">缩略图高</label>
            <div class="layui-input-inline">
                <input type="text" name="img_height" autocomplete="off" value="" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>

        <!--多图片-->
        <div class="layui-form-item nc_hide" data-name="args_imgs">
            <label class="layui-form-label">允许图片类型</label>
            <div class="layui-input-inline">
                <input type="text" name="imgs_allow_image_type" autocomplete="off" value="jpg,png,gif" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_imgs">
            <label class="layui-form-label">开启图片水印</label>
            <div class="layui-input-inline">
                <select name="imgs_open_image_mark"  class="nc-len-long">
                    <option value="0">否</option>
                    <option value="1">是</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_imgs">
            <label class="layui-form-label">缩略图宽</label>
            <div class="layui-input-inline">
                <input type="text" name="imgs_width" autocomplete="off" value="" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_imgs">
            <label class="layui-form-label">缩略图高</label>
            <div class="layui-input-inline">
                <input type="text" name="imgs_height" autocomplete="off" value="" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>

        <!--文件上传-->
        <div class="layui-form-item nc_hide" data-name="args_file">
            <label class="layui-form-label">允许文件类型</label>
            <div class="layui-input-inline">
                <input type="text" name="file_allow_file_type" autocomplete="off" value="rar,zip,doc,docx" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>

        <!--多文件上传-->
        <div class="layui-form-item nc_hide" data-name="args_files">
            <label class="layui-form-label">允许文件类型</label>
            <div class="layui-input-inline">
                <input type="text" name="files_allow_file_type" autocomplete="off" value="rar,zip,doc,docx" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>

        <!--数字-->
        <div class="layui-form-item nc_hide" data-name="args_number">
            <label class="layui-form-label">取值范围</label>
            <div class="layui-input-inline nc-len-shor">
                <input type="number" name="number_min" autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
            <div class="layui-form-mid">-</div>
            <div class="layui-input-inline nc-len-shor">
                <input type="number" name="number_max" autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_number">
            <label class="layui-form-label">小数位数</label>
            <div class="layui-input-inline">
                <select name="number_decimal_places"  class="nc-len-long">
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item nc_hide" data-name="args_number">
            <label class="layui-form-label">默认值</label>
            <div class="layui-input-inline">
                <input type="text" name="number_default_value" autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>

        <!--时间-->
        <div class="layui-form-item nc_hide" data-name="args_time">
            <label class="layui-form-label">时间格式</label>
            <div class="layui-input-inline">
                <select name="time_style"  class="nc-len-long">
                    <option value="Y-m-d">年月日</option>
                    <option value="Y-m-d H:i:s">年月日 时分秒</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">属性后缀</label>
            <div class="layui-input-inline">
                <input type="text" name="postfix" autocomplete="off" placeholder="选填 例：㎡、㎞、㎏、元" class="layui-input nc-len-long">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">字段提示</label>
            <div class="layui-input-inline">
                <input type="text" name="placeholder" autocomplete="off" placeholder="" class="layui-input nc-len-long">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">检验正则</label>
            <div class="layui-input-inline">
                <input type="text" name="reg" autocomplete="off" placeholder="" class="layui-input nc-len-mid">
            </div>
            <div class="layui-input-inline">
                <select name="reg_type"  class="nc-len-long" lay-filter="reg_type">
                    <option value="0">请选择</option>
                    {volist name="input_regex_arr" id="vo"}
                    <option value="{$vo.regex_value}">{$vo.regex_name}</option>
                    {/volist}
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">值唯一</label>
            <div class="layui-input-inline">
                <select name="unique"  class="nc-len-long">
                    <option value="0">否</option>
                    <option value="1">是</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">必填</label>
            <div class="layui-input-inline">
                <select name="required"  class="nc-len-long">
                    <option value="0">否</option>
                    <option value="1">是</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">可搜索</label>
            <div class="layui-input-inline">
                <select name="search_able"  class="nc-len-long">
                    <option value="1">是</option>
                    <option value="0">否</option>
                </select>
            </div>
        </div>

        <div class="nc-form-row">
            <input type="hidden" name="category_id" value="{$category_id}">
            <button class="layui-btn" lay-submit lay-filter="btnAttribute" type="button">保存</button>
            <!-- <button class="layui-btn layui-btn-primary" onclick="window.location.href = window.history.go(-1);">取消</button> -->
            <button onclick="window.history.back(-1)" class="layui-btn layui-btn-primary">返回</button>
        </div>
    </div>


</div>

{/block}
{block name="script"}
<script>
        var url = "sns://sitehome/info/addCategoryAttribute";
    </script>
<script src="SNS_JS/category_attribute.js"></script>
{/block}